package com.homework.module4part2.service.impl;
import com.homework.dao.domain.Order;
import com.homework.dao.mappers.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homework.module4part2.service.OrderService;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    public boolean addOrder(Order order) {
        return orderMapper.addOrder(order);
    }

    public Order findOrderByUid(int uid) {
        if(uid <= 0) {
            return null;
        }

        return orderMapper.findByUid(uid);
    }
}
